package core.september.cloudbadge.model.badge;

import java.util.LinkedList;
import java.util.List;

import ezvcard.types.StructuredNameType;

public class UserField extends AbsField{

	private String name;
	private String surname;
	private String organization;
	private String title;
	private boolean hasHomeField = false;
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getSurname() {
		return surname;
	}
	public void setSurname(String surname) {
		this.surname = surname;
	}
	public String getOrganization() {
		return organization;
	}
	public void setOrganization(String organization) {
		this.organization = organization;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public boolean hasHomeField() {
		return hasHomeField;
	}
	public void setHasHomeField(boolean hasHomeField) {
		this.hasHomeField = hasHomeField;
	}
	@Override
	public void commit() {
			
			StructuredNameType st = new StructuredNameType();
			st.setFamily(getSurname());
			st.setGiven(getName());
			getVcard().setStructuredName(st);
			getVcard().setOrganization(getOrganization());
			getVcard().getTitles().clear();
			getVcard().addTitle(getTitle());
		}

}
